<template>
  <div>
    <el-radio
      label="正确"
      v-model="localAnswer"
    />
    <el-radio
      label="错误"
      v-model="localAnswer"
    />
  </div>
</template>

<script>
export default {
  props: {
    correctAnswer: String
  },
  data() {
    return {
      localAnswer: this.correctAnswer || '正确' // 默认值
    };
  },
  watch: {
    correctAnswer(newVal) {
      this.localAnswer = newVal;
    },
    localAnswer(newVal) {
      this.$emit('updateCorrectAnswer', newVal);
    }
  }
};
</script>
